package cn.stylefeng.guns.modular.demo.utils;
import java.util.Random;

/**
 *	生成随机数
 */
public class RandomsUtil {

	/**
	 * 生成n位随机数
	 * @param n
	 * @return
	 */
	public static String getRandom(int n){
		Random random = new Random();
        StringBuilder number = new StringBuilder();
        for (int i = 0; i < n; i++) {
            int digit = random.nextInt(10);
            number.append(digit);
        }
		return number+"";
	}

}
